﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../include/head.jspf"%>   
<title>东方易云后台管理系统</title>
<style>
body { background: #f5f5f5 ;}
</style>
<link rel="stylesheet" href="resource/css/jquery-ui.css" type="text/css"  />
<script type="text/javascript" src="resource/js/jquery-ui.js"></script>
<script>
function editCompanyFlow(){
	var vTotal=$('#listSize').val();
	if(vTotal>0){
		for(var i=1;i<=vTotal;i++){
			if($('#'+i).val().length==0){
				alert("请填写企业平台编号");
				return;
			}
			if($('#serviceCode_'+i).val().length==0){
				alert("请选择服务类型");
				return;
			}
		}
	}
	$('#editForm').submit();
}
function fillflowAtcor(ob,v){
	var ecCode=v;
	var id=ob.attr("id");
	$('#serviceCode_'+id).empty();
	$('#ceName_'+id).empty();
	if(ecCode.length>0){
		var data = getDataByAjax("services/dataxFlow/getEnterpriseServiceType",{ "fiId": ecCode});
			if(data.flag){
				$('#ceName_'+id).append(data.vwDataxEnterpriseVO.ecName);	
				$('#serviceCode_'+id).append(data.option);	
			}else{
				ob.val("");
			}
	}
}

$(document).ready(function(){
	$(".ecCodeInput").autocomplete({source:"services/dataxFlow/getEnterpriseCode?originateCop="+$(this).val(),select: function(e,ui){
					fillflowAtcor($(this),ui.item.value);
	}});
	$('.ecCodeInput').change(function(){fillflowAtcor($(this),$(this).val())});

});
</script>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="js/pngfix.js"></script>
<![endif]-->
</head>
<body>
<form method="post" action="companyFlowEditSubmit" id="editForm">
<input type="hidden" name="pageNo" value="<c:out value='${pageNo}' />"/>
<input type="hidden" name="flowIdSelect" value="<c:out value='${flowIdSelect }' />"/>
<input type="hidden" name="originateCopSelect" value="<c:out value='${originateCopSelect}' />"/>
<input type="hidden" name="eNameSelect" value="<c:out value='${eNameSelect}' />"/>
<input type="hidden" id="statusSelect" name="statusSelect" value="<c:out value='${statusSelect }' />">
<input type="hidden" name="flowTempIdSelect" id="flowTempIdSelect" value="<c:out value='${flowTempIdSelect }' />"/>

<input type="hidden" name="flowId" value="<c:out value="${dataxFlowVO.id.flowId}" />" />
<input type="hidden" name="flowTemplateId" value="<c:out value="${dataxFlowVO.id.flowTemplateId}" />" />
<div id="body-wrapper">

  <!-- Wrapper for the radial gradient background -->
  <div id="main-content">
    <!-- Main Content Section with everything -->
    <!-- Page Head -->
    <div id="page-title">
      <h3>企业业务流程新建</h3>
    </div>
    <div class="pgline"></div>

    <div class="bulk-actions align-left"> <a class="button2" href="javascript:void(0);" onclick="editCompanyFlow();">保存</a> </div>
    <div class="clear"></div>
    

    <div id="page-title">
      <h4>业务流程基本信息</h4>
    </div>
    <div class="pgline"></div>
    <div class="clear"></div>

    <div class="bulk-actions align-left"> </div>
    <div class="clear"></div>
    <div class="notification querytj png_bg">
      <div>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="13%" height="35" align="right">&nbsp;&nbsp;公共模板编号： </td>

            <td width="29%"><c:out value="${dataxFlowTemplateVO.flowTemplateId}" /></td>
            <td width="15%" align="right">公共模板名称： </td>
            <td width="26%"><c:out value="${dataxFlowTemplateVO.flowTemplateName}" /></td>
          </tr>
          <tr>
            <td height="35" align="right">&nbsp;&nbsp;业务类型： </td>

            <td height="35"><c:out value="${dataxFlowTemplateVO.businessType}" /></td>
            <td width="15%" align="right">业务流程编号： </td>
            <td width="26%"><c:out value="${dataxFlowVO.id.flowId}" /></td>
          </tr>
          <tr>
            <td height="35" align="right">业务流程名称：</td>
            <td height="35"><c:out value="${dataxFlowVO.flowName}" /></td>
            <td height="35" align="right">发起单位平台编号：</td>

            <td height="35"> <c:out value="${dataxFlowVO.originateCop}" /> </td>
          </tr>
          <tr>
            <td height="35" align="right">业务流程备注： </td>
            <td height="35" colspan="3"><textarea name="notes" rows="3"  class="input3" style="width:600px" maxlength="255" ><c:out value="${dataxFlowVO.notes}" /></textarea></td>
          </tr>
        </table>
      </div>

    </div>
    
<div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>节点信息</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->

      <div class="content-box-content">
        <div class="tab-content default-tab">
          <table>
            <thead>
              <tr>
                <th>节点编号</th>
                <th>节点名称</th>
                <th>企业平台编号</th>
                <th>企业平台名称</th>
                <th>服务类型</th>
              </tr>
            </thead>
            <tfoot>
             
            </tfoot>
            <tbody>
            <input type="hidden" id="listSize" name="listSize" value="<c:out value="${listSize}" />" >
	             <c:forEach var="dataxflowActorsVO" items="${listFlowActors}" varStatus="s" >
	              <tr>
	                <td><c:out value="${dataxflowActorsVO[0].id.actorNo}"></c:out></td>
	                <td><c:out value="${dataxflowActorsVO[0].actorName}"></c:out></td>
	                <td><input id="<c:out value="${s.count}" />" name="ecCode_${s.count}" value="<c:out value="${dataxflowActorsVO[0].eCode}" />" type="text" style=" border:1px solid black;"  class="ecCodeInput"  maxlength="12"/></td>
	                <td><div id="ceName_<c:out value="${s.count}" />" ><c:out value="${dataxflowActorsVO[1]}" /></div></td>
	                <td> <select id="serviceCode_<c:out value="${s.count}" />" name="serviceCode_${s.count}" style="border:solid 1px #111">
	                	 	<c:forEach var="serviceType" items="${listServiceType}"> 
              	 				<c:choose>
	   								<c:when test="${dataxflowActorsVO[0].serviceCode==serviceType.id.fcCode}">
	   									<option value="<c:out value="${serviceType.id.fcCode}" />" selected="selected"><c:out value="${serviceType.fcName}" /></option>
	   								</c:when>
	   							</c:choose>
	          			</c:forEach>
	                	</select>
	                </td>
	                <input type="hidden" id="actorNo_<c:out value="${s.count}" />" name="actorNo_<c:out value="${s.count}" />" value="<c:out value="${dataxflowActorsVO[0].id.actorNo}" />" >
	                <input type="hidden" id="actorName_<c:out value="${s.count}" />" name="actorName_<c:out value="${s.count}" />" value="<c:out value="${dataxflowActorsVO[0].actorName}" />" >
	               
	               
	              </tr>
	              </c:forEach>
            </tbody>
          </table>
        </div>
        <!-- End #tab1 -->
      </div>
      <!-- End .content-box-content -->
    </div>    

    

  </div>

  <!-- End #main-content -->
</div>
</form>
</body>
</html>
